package com.xiong.controller;

import com.xiong.pojo.Course;
import com.xiong.response.ResultBean;
import com.xiong.service.CourseService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 熊宇
 * @date 2022/4/29 15:13
 * @description course
 */
@RestController
@RequestMapping("/course")
public class CourseController {

    @Autowired
    private CourseService courseService;


    /**
     *  模糊查询课程名
     * @param courseName
     * @return
     */
    @GetMapping("/selectByCourseName/{courseName}/{pageNum}/{pageSize}")
    public ResultBean selectByCourseName(@PathVariable("courseName") String courseName,@PathVariable("pageNum") int pageNum,@PathVariable("pageSize") int pageSize){

        return ResultBean.suc(courseService.selectByCourseName(courseName,pageNum,pageSize));
    }
}
